<?php
	use yii\helpers\Html; 
	echo \yii\captcha\Captcha::widget([
		'model' => $code,
	'attribute' => 'code',
	'captchaAction' => 'code/captcha',
	//'template' => '{input} --- {image}',
	'options' => [
		'id' => 'input'
	],
	'imageOptions' =>[
		'alt' => '点击换验证码',
	]
		]);
?>